package mail;

import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;


public class EmailUtils {

	public static SimpleEmail crearEmail(String asunto, String cuerpoMail, String mailTo, String mailFrom, String smtpHost) throws EmailException{
		SimpleEmail email = new SimpleEmail();
		email.setHostName(smtpHost);
		email.setSmtpPort(465);
		email.setFrom(mailFrom);
		email.addTo(mailTo);

		// agrego copias ocultas con proposito de testing
		/*List<String> mailsCopias = DaemonMailsCopia.obtenerMailsCopiaSeguridadSocial();
		for (String emailBcc : mailsCopias) {
			email.addBcc(emailBcc);
		}*/

		email.setSubject(asunto);
		email.setMsg(cuerpoMail);

		// Para mandarlo simplemente es: email.send();

		return email;
	}


}
